package com.yanu.t2s.controller;

import com.yanu.t2s.entity.Yangzhi;
import com.yanu.t2s.service.YangzhiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("yangzhi")
public class YangzhiController {
    @Autowired
    YangzhiService yangzhiService;
    @GetMapping("get/{yangzhiid}")
    public Yangzhi findByIdYangzhi(@PathVariable int yangzhiid) {
        System.out.println(yangzhiid);
        return yangzhiService.findByIdYangzhi(yangzhiid);
    }

    @GetMapping("get/all")
    public List<Yangzhi> findAllYangzhi() {
        return yangzhiService.findAllYangzhi();
    }


}
